<?php
/**
 * Created by PhpStorm.
 * User: HelloWorld
 * Date: 2019/09/26
 */
class Func_MakePdf_Main{
    //生成起诉书
    public static function make($data,$path,$template = 'TemplateConf.php'){
        //获取html文本
        try {
            $tpl = Func_MakePdf_GetIndictment::get($data,$template);
            //生成pdf
            if(RUNTIME_ENV == "local"){
                Func_MakePdf_Mpdf::make($tpl,$path);
            }else{
                Func_MakePdf_Wkhtmltox::make($tpl,$path);
            }
            return $path;
        } catch( Exception $e) {
            Func_Log::write('MakePdf', 'Error', "path : ".$path."data" .json_encode($data) . 'error' . $e->getMessage());
        }

    }
}